<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="stylesheet" href="http://www.petercorke.com/RVC/common/toolboxhelp.css">
    <title>M-File Help: hist2d</title>
  </head>
  <body>
  <table border="0" cellspacing="0" width="100%">
    <tr class="subheader">
      <td class="headertitle">M-File Help: hist2d</td>
      <td class="subheader-left"><a href="matlab:open hist2d">View code for hist2d</a></td>
    </tr>
  </table>
<h1>hist2d</h1><p><span class="helptopic">MEX file to compute 2-D histogram.</span></p>[<strong>h</strong>,<strong>vx</strong>,<strong>vy</strong>] = <span style="color:red>hist2d</span>(<strong>x</strong>,<strong>y</strong>)

or

[<strong>h</strong>,<strong>vx</strong>,<strong>vy</strong>] = <span style="color:red>hist2d</span>(<strong>x</strong>,<strong>y</strong>,[x0 dx nx],[y0 dy ny])

Inputs:

<table class="list">
  <tr><td style="white-space: nowrap;" class="col1">x, y</td> <td>data points.  {x(i),y(i)} is a single data point.</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> x0</td> <td>lowest x bin's lower edge</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> dx</td> <td>x bin width</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> nx</td> <td>number of x bins</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> y0</td> <td>lowest y bin's lower edge</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> dy</td> <td>y bin width</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> ny</td> <td>number of y bins</td></tr>
</table>
<pre style="width: 90%%;" class="examples">
[x0,dx,nx]&nbsp;and&nbsp;[y0,dy,ny]&nbsp;default&nbsp;=&nbsp;[0,1,256]
</pre>
Outputs:

<table class="list">
  <tr><td style="white-space: nowrap;" class="col1"> h </td> <td>histogram matrix.  h(i,j) = number of data points
satisfying vx(j) <= x < vx(j+1) and vy(i) <= y < vy(i+1).</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> vx</td> <td>bin lower x-ordinates (one for each column of h)</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> vy</td> <td>bin lower y-ordinates (one for each row of h)</td></tr>
</table>
Michael Maurer, 7 October 1994.
Copyright 1994 by Michael Maurer.

<hr>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
  <tr class="subheader" valign="top"><td>&nbsp;</td></tr></table>
<p class="copy">&copy; 1990-2011 Peter Corke.</p>
</body></html>